home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
INFO
/
DOSTRAIN.ZIP
/
MAKEFILE.BAS
< prev
next >
Wrap
BASIC Source File
|
1986-10-06
|
2KB
|
42 lines
10 CLS
20 KEY OFF
30 LOCATE 1,1,1
40 DIM F$(100)
50 PRINT"Okay, just start typing your file whenever you are ready."
60 PRINT "When you are finished, type CTRL-Q.": PRINT : PRINT
70 P=1
80 I$=INKEY$
90 IF I$="" THEN 80
100 IF ASC(I$)=8 THEN GOSUB 350: GOTO 80
110 IF LEN(I$)=2 AND ASC(RIGHT$(I$,1))=83 THEN GOSUB 350: GOTO 80
120 IF I$=CHR$(13) THEN PRINT: C=1: F$(P)=L$: P=P+1: L$="": GOTO 80
130 IF I$=CHR$(17) THEN GOTO 180
140 IF I$<CHR$(32) OR I$>CHR$(126) THEN BEEP: GOTO 80
150 IF LEN(I$)<>1 THEN BEEP: GOTO 80
160 IF C>65 THEN BEEP: GOTO 80
170 PRINT I$;:C=C+1: L$=L$+I$: GOTO 80
180 PRINT: PRINT
190 IF C<>1 THEN F$(P)=L$: P=P+1
192 PRINT "Okay, now I will save the text you have typed in a disk file.
194 INPUT "Which floppy disk drive do you want to save the file on? ", DR$
196 IF DR$<>"a" AND DR$<>"A" AND DR$<>"b" AND DR$<>"B" THEN PRINT "The drive should be A or B only!": GOTO 194
200 print
210 PRINT "Give me a file name consisting of no more than eight"
220 INPUT "characters: ", FLNAME$
230 IF LEN(FLNAME$) >8 OR LEN(FLNAME$) < 1 THEN PRINT: PRINT "DOS filenames must be between 1 and 8 characters!": PRINT: GOTO 200
240 PRINT
270 OPEN "o", #1, DR$+":"+FLNAME$
280 FOR I=1 TO P: PRINT#1 , F$(I): NEXT I
290 CLOSE
300 PRINT: PRINT "Your file has been saved on drive '";DR$;"' under the name '";FLNAME$;
310 PRINT "'.
320 PRINT "You can check that out using the DIR and TYPE commands."
330 PRINT
340 STOP
350 REM BACKSPACE
360 X=POS(0)
370 LOCATE ,X-1,1: PRINT " ";:LOCATE ,X-1,1: C=C-1
380 L$=LEFT$(L$,LEN(L$)-1)
390 IF C=0 THEN C=1
400 RETURN